﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Gizmox.WebGUI.Common.Resources;
using Gizmox.WebGUI.Forms;

namespace Bronze.ReportBuilder.Toolbox.Controls
{
    [Serializable]
    public class SplitContainerItem : BaseToolboxItem
    {
        bool showBorder=true;
        public override bool ShowBorder
        {
            get
            {
                return showBorder;
            }
            set
            {
                showBorder = value;
            }
        }

        public override Type ControlType
        {
            get { return typeof(SplitContainer); }
        }

        public override IconResourceHandle Icon
        {
            get
            {
                return new IconResourceHandle("Toolbox.Control_DockPanel.png");
            }
        }

        public override Control Create(string name)
        {
            var size = new System.Drawing.Size(300, 230);
            return new SplitContainer { Size = size, Name = name };
        }

        public override string ControlName
        {
            get { return "SplitContainer"; }
        }
    }


    #region Panel
    [Serializable]
    public class PanelItem : BaseToolboxItem
    {
        bool showBorder = true;
        public override bool ShowBorder
        {
            get
            {
                return showBorder;
            }
            set
            {
                showBorder = value;
            }
        }

        public override Type ControlType
        {
            get { return typeof(Panel); }
        }

        public override string ControlName
        {
            get { return "Panel"; }
        }

        public override IconResourceHandle Icon
        {
            get
            {
                return new IconResourceHandle("Toolbox.Control_Box.png");
            }
        }

        public override Control Create(string name)
        {
            TrackProperties.Add("Controls");
            var size = new System.Drawing.Size(300, 300);
            var panel = new Panel { Size = size, Name = name };
            return panel;
        }

    }

    #endregion


    [Serializable]
    public class CommonFormItem : BaseToolboxItem
    {
        public override Type ControlType
        {
            get { return typeof(CommonForm); }
        }

        public override IconResourceHandle Icon
        {
            get
            {
                return new IconResourceHandle("Toolbox.Control_DockPanel.png");
            }
        }

        public override Control Create(string name)
        {
            var size = new System.Drawing.Size(500, 500);
            var frm = new CommonForm() { Size = size, Name = name };
            return frm;
        }

        public override string ControlName
        {
            get { return "CommonForm"; }
        }
    }

}